<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"   
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>	   	
	   	<f:viewParam name="firstResult" value="#{complaintList.firstResult}"></f:viewParam>	
	   	<f:viewParam name="handled" value="#{complaintList.handled}"></f:viewParam>
	   	<f:viewParam name="moduleName" value="投诉管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="searchForm">
			<p:panel header="咨询投诉查询" style="margin-bottom:10px;">
				<p:messages id="messages" />	
		        
		        <h:panelGrid columns="4" cellpadding="5">
					<p:selectOneRadio
						id="handled"
						value="#{complaintList.handled}"
					>
						<f:selectItem itemLabel="不限" itemValue="#{null}"/>
						<f:selectItem itemLabel="已处理" itemValue="#{true}"/>
						<f:selectItem itemLabel="未处理" itemValue="#{false}"/>
					</p:selectOneRadio>	
				</h:panelGrid>
		    	    	
		    	<p:commandButton action="ComplaintList.xhtml?faces-redirect=true&amp;includeViewParams=true&amp;firstResult=0" ajax="false" value="查询">		    		
		    	</p:commandButton>
			</p:panel>
			
			<p:panel id="searchResult">
				<f:facet name="header">咨询投诉管理</f:facet>
				<p:dataTable value="#{complaintList.resultList}" var="_complaint">
										
					<p:column>
						<f:facet name="header">标题</f:facet>
						<h:outputText value="#{_complaint.title}" />						
					</p:column>
					
					<p:column headerText="上报时间">
						<h:outputText value="#{_complanit.createDate}">
							<f:convertDateTime pattern="yyyy-MM-dd HH"/>
						</h:outputText>
					</p:column>
					
					<p:column headerText="状态">
						<h:outputText value="#{_complaint.handled ? '是' : '否'}" />
					</p:column>
				
					<p:column style="text-align: center;width:100px;">
						<f:facet name="header">操作</f:facet>
						<p:button outcome="ComplaintHandle.xhtml" value="处理">
							<f:param name="complaintId" value="#{_complaint.id}"></f:param>
						</p:button>
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
				<ui:param name="entityList" value="#{complaintList}" />
			</ui:include>
			
		</h:form>
      
   	</ui:define>
</ui:composition>
